package com.chuanye.mydrawable.views;

import android.app.TimePickerDialog;
import android.content.Context;

import java.util.Calendar;

/**
 * Created by yiqiang on 2018/7/5.
 */

public class TimeDialog extends TimePickerDialog {
    public TimeDialog(Context context, long time, OnTimeSetListener callBack) {
        super(context, callBack, 0, 0, true);
        Calendar calendar = Calendar.getInstance();
        try {
            if (time > 0)
                calendar.setTimeInMillis(time);
        } catch (Exception e) {
            e.printStackTrace();
        }
        updateTime(calendar.get(Calendar.HOUR_OF_DAY), calendar.get(Calendar.MINUTE));
//        init();
    }

    public TimeDialog(Context context, OnTimeSetListener callBack, int hourOfDay, int minute, boolean is24HourView) {
        super(context, callBack, hourOfDay, minute, is24HourView);
//        init();
    }
//    public void init() {
//        getWindow().getAttributes().gravity = Gravity.CENTER;
//    }
}
